let network = require("../../utils/network/network.js")
let api = require("../../utils/network/config.js").api;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    detectInfo: {
      detectId: 1,
      detectNum: 153,
      detectTime: "12-12 13:3",
      orderId: 1,
      resultUrl: "",
      stickId: 1,
      userId: 22
    },
    stickInfo: {},
    detectId: -1

  },
  onLoad(options) {
    console.log(options)
    if (options.detectId) {
      let detectId = options.detectId
      this.setData({
        detectId: Number(detectId)
      })
    }
    this.getDetectInfo()
  },
  getDetectInfo() {
    let that = this
    network.fetch({
        url: api.detect_info,
        inBody: false,
        data: {
          detectId: that.data.detectId
        },
        method: 'GET',
      })
      .then(res => {
        console.log(res)
        this.setData({
          detectInfo: res.data.detect,
          stickInfo: res.data.stick,
        })
      })
  },
  sendError() {
    wx.showLoading({
      title: '请求中',
    })
    setTimeout(() => {

      wx.hideLoading()
      wx.showToast({
        title: '报错信息已提交，感谢您的支持！',
        icon: 'none',
        duration: 2000
      })
    }, 800);

  }

})